//---------------------------------------------------------------------------

#ifndef uSelPrinterH
#define uSelPrinterH
//---------------------------------------------------------------------------
#include <registry.hpp>
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include "CEdit.h"
#include "CEditNum.h"
#include "CGBox.h"
#include <Graphics.hpp>
#include <ExtCtrls.hpp>
#include <ImgList.hpp>
#include <Buttons.hpp>
#include <Dialogs.hpp>
#include <ComCtrls.hpp>
#include "CBitBtn.h"
//#include <Printers.hpp>
//---------------------------------------------------------------------------
class TSelPrinter : public TForm
{
    typedef inherited TForm;
__published:	// Composants gérés par l'EDI
    TComboBox *cbPrinter;
    TButton *btPropriete;
    TLabel *lblEtat;
    TLabel *lblEmplacement;
    TLabel *lblCommentaire;
    TRadioButton *rbTout;
    TRadioButton *rbPageCourante;
    TRadioButton *rbPages;
    CEditNum *enDe;
  TLabel *lblaLaPage;
    CEditNum *enA;
    TGroupBox *gpbBox1;
    TLabel *lblType;
    CBitBtn *btnOK;
    CBitBtn *btnCancel;
  CGroupBox *gpbCopies;
  TImage *ImNonAssemblees;
  TImage *ImAssemblees;
  TLabel *lblAssembleeUnsupported;
  CEditNum *enCopies;
  TCheckBox *cbAssemblee;
  TUpDown *udCopies;
  TLabel *lblDe;
  TGroupBox *GroupBox1;
  CEditNum *edZoom;
  TUpDown *UpDown1;
  TCheckBox *cbPaysagePortraitAssembles;
  TBitBtn *btnGED;
  TLabel *lblDeLaPage;
    void __fastcall cbPrinterChange(TObject *Sender);
    void __fastcall btProprieteClick(TObject *Sender);
    void __fastcall rbToutClick(TObject *Sender);
    void __fastcall enCopiesChange(TObject *Sender);
    void __fastcall cbAssembleeClick(TObject *Sender);
    void __fastcall enDeChange(TObject *Sender);
    void __fastcall enAChange(TObject *Sender);
    void __fastcall udCopiesChangingEx(TObject *Sender, bool &AllowChange,
          short NewValue, TUpDownDirection Direction);
    void __fastcall btnOKClick(TObject *Sender);
    void __fastcall btnCancelClick(TObject *Sender);
  void __fastcall FormKeyDown(TObject *Sender, WORD &Key,
          TShiftState Shift);
  void __fastcall btnGEDClick(TObject *Sender);
  void __fastcall edZoomChange(TObject *Sender);
private:	// Déclarations utilisateur
    TRegistry *m_Reg;
    TPrintDialogOptions m_FOptions;
    char                m_ADevice[255], m_ADriver[255], m_APort[255];
    DEVMODE             *m_pDevMode;
    HGLOBAL             m_hDeviceMode;
    void        __fastcall FreeDevMode(int freeAll=true);
    void        __fastcall Init();
    void        __fastcall Refresh();

    TPrintRange __fastcall GetPrintRange( );
    void        __fastcall SetPrintRange( TPrintRange p);
    int         __fastcall GetFromPage( );
    void        __fastcall SetFromPage( int i);
    int         __fastcall GetToPage( );
    void        __fastcall SetToPage( int i);
    int         __fastcall GetMinPage( );
    void        __fastcall SetMinPage( int i);
    int         __fastcall GetMaxPage( );
    void        __fastcall SetMaxPage( int i);
    AnsiString  __fastcall GetDocName( );
    void        __fastcall SetDocName( const AnsiString &s);
    bool        __fastcall GetCollate( );
    void        __fastcall SetCollate( bool i);
    int         __fastcall GetCopies( );
    void        __fastcall SetCopies( int i);
    bool        __fastcall GetCopiesShow( );
    void        __fastcall SetCopiesShow( bool i);
public:		// Déclarations utilisateur
    __fastcall TSelPrinter(TComponent* Owner);
    virtual __fastcall ~TSelPrinter();
    int __fastcall ShowModal(void);
    __property TPrintRange PrintRange={read=GetPrintRange, write=SetPrintRange};
    __property int         FromPage  ={read=GetFromPage,   write=SetFromPage};
    __property int         ToPage    ={read=GetToPage,     write=SetToPage};
    __property int         MinPage   ={read=GetMinPage,    write=SetMinPage};
    __property int         MaxPage   ={read=GetMaxPage,    write=SetMaxPage};
    __property AnsiString  DocName   ={read=GetDocName,    write=SetDocName};
    __property bool        Collate   ={read=GetCollate,    write=SetCollate};
    __property int         Copies    ={read=GetCopies,     write=SetCopies};
    __property bool        CopiesShow={read=GetCopiesShow, write=SetCopiesShow};
    __property TPrintDialogOptions Options = {read=m_FOptions, write=m_FOptions};

};
//---------------------------------------------------------------------------
extern TSelPrinter *SelPrinter;
//---------------------------------------------------------------------------
#endif
